function callAjax(domobj) {
    var obj = $(domobj)

    $.ajax({
       type: "POST",
       url: "ajax",
       data: JSON.stringify({name: obj.attr("name"), value: obj.attr("value")}),
       contentType: 'application/json',
       dataType: 'json',
       success: function(data) {
          obj.attr("value", data.result)
      }
  })
}